//
//  ProgressHUD.swift
//  globalcarbusiness
//
//  Created by dongzhenyu on 2017/8/14.
//  Copyright © 2017年 dongzhenyu. All rights reserved.
//

import UIKit
import SVProgressHUD
import MBProgressHUD

class ProgressHUD: NSObject {

}

extension ProgressHUD {
    
    class func show(withStatus message: String) {
        SVProgressHUD.show(withStatus: message)
    }
    
    class func show() {
        SVProgressHUD.show()
    }
    
    class func showInfo(withStatus message: String) {
        SVProgressHUD.setMinimumDismissTimeInterval(1)
        SVProgressHUD.showInfo(withStatus: message)
    }
    
    class func dismiss() {
        SVProgressHUD.dismiss()
    }
    
    class func showSuccess(withStatus message: String) {
        SVProgressHUD.setMinimumDismissTimeInterval(1)
        SVProgressHUD.showSuccess(withStatus: message)
    }
    
    class func showError(withStatus message: String) {
        SVProgressHUD.setMinimumDismissTimeInterval(1)
        SVProgressHUD.showError(withStatus: message)
    }
    
    // MARK: - MBProgressHUD
    class func alert(message: String, on vc: UIViewController) {
        
        DispatchQueue.main.async {
            let hud = MBProgressHUD.showAdded(to: vc.view, animated: true)
//            hud?.mode = MBProgressHUDMode.text
//            hud?.detailsLabelText = message
//            hud?.detailsLabelFont = UIFont.boldSystemFont(ofSize: 20)
//            hud?.hide(true, afterDelay: 1)
        }
    }
    
}
